System.register(["@angular/http", "@angular/core", "app/Service"], function (exports_1, context_1) {
    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var __moduleName = context_1 && context_1.id;
    var http_1, core_1, Service_1, AppComp, _a;
    return {
        setters: [
            function (http_1_1) {
                http_1 = http_1_1;
            },
            function (core_1_1) {
                core_1 = core_1_1;
            },
            function (Service_1_1) {
                Service_1 = Service_1_1;
            }
        ],
        execute: function () {
            AppComp = (function () {
                function AppComp(http, notify) {
                    var _this = this;
                    this.http = http;
                    this.notify = notify;
                    this.hasLogin = false;
                    this.http.get({
                        search: {
                            m: "Admin",
                            c: "ApiSchool",
                            a: "getOrderList",
                            page: 1,
                            count: 1
                        }
                    }).then(function (data) {
                        _this.hasLogin = true;
                    });
                    notify.subscribe(function (login) {
                        _this.hasLogin = login;
                    });
                }
                AppComp.prototype.loginSuccess = function (login) {
                    var _this = this;
                    this.http.get({
                        search: {
                            m: "Admin",
                            c: "ApiBox",
                            a: "getBoxBySchool"
                        }
                    }).then(function (data) {
                        _this.hasLogin = true;
                        _this.hasLogin = login;
                    });
                };
                return AppComp;
            }());
            AppComp = __decorate([
                core_1.Component({
                    selector: ".main_body",
                    template: '<div class="login_pane" (loginSuccess)="loginSuccess($event)" *ngIf="!hasLogin"></div>' +
                        '<aside class="menu side_menu" *ngIf="hasLogin"></aside>' +
                        '<div class="work_pane"  [ngClass]="{hide: !hasLogin}"></div>'
                }),
                __metadata("design:paramtypes", [http_1.Http, typeof (_a = typeof Service_1.Notify !== "undefined" && Service_1.Notify) === "function" && _a || Object])
            ], AppComp);
            exports_1("AppComp", AppComp);
        }
    };
});
